To run scripts using the command-line-based script host (Cscript.exe)
cscript [script name] [host parameters] [script parameters]
Where:
script name is the name of the script file, complete with extension and any necessary path information.
host parameters are the command line switches that enable or disable various Windows Script Host features. Host parameters are always preceded by two slashes (//).
script parameters are the command line switches that are passed to the script. Script parameters are always proceeded by one slash (/).
Notes
Parameter | Action |
---|---|
//B | Specifies batch mode, which will not display alerts, scripting errors, and input prompts. |
//D | Turns on the debugger. |
//E:engine | Specifies the scripting language used to run the script. |
//H:cscript or //H:wscript | Registers Cscript.exe or Wscript.exe as the default application for running scripts. If neither is specified, Wscript.exe is assumed as the default. |
//I | Specifies interactive mode, which displays alerts, scripting errors, and input prompts. This is the default, and the opposite of //B. |
//Job:xxxx | Runs the specified job. |
//Logo | Specifies that the banner will display at run time. This is the default, and the opposite of //Nologo. |
//Nologo | Specifies that no banner will display at run time. |
//S | Saves the current command prompt options for this user. |
//T:nnnnn | Specifies the maximum time the script can run in seconds. You can specify up to 32,767 seconds. The default is no time limit. |
//X | Launches the script in the debugger. |
//? | Displays available command parameters and provides help for using them (same as typing Cscript.exe with no parameters and no script). |